home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7930 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  652 b 

  1. Path: csus.edu!news
  2. From: wleong@sfsu.edu (Jerry Leong)
  3. Newsgroups: comp.lang.c
  4. Subject: macro that return value, how?
  5. Date: Wed, 28 Feb 1996 05:35:35 GMT
  6. Organization: San Francisco State University
  7. Message-ID: <3133e87b.868433@news.csus.edu>
  8. NNTP-Posting-Host: wleong@pluto.sfsu.edu
  9. X-Newsreader: Forte Agent .99d/32.182
  10.  
  11.  
  12. Hi,
  13.     I need to define a macro that will first calculate a given a
  14. parameter and then return it. How can I do that?
  15.  
  16. p/s: Say I pass a value to the macro, macro will perform some
  17. addition, then return the value.
  18.  
  19. #define add1(x)  { x+=VAR; return x; }   
  20.  
  21. something like that by the above does not compile.
  22. Thanx in advance!
  23.